
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>
        商铺管理
    </title>

    <link rel="stylesheet" href="../static/css/main.css" media="all">
    <script type="text/javascript" src="../static/lib/loading/okLoading.js"></script>

</head>
<style>
    .imgs{display: none;}
    .picture{display: none;}
</style>
<body>
<div class="x-nav">
            <span class="layui-breadcrumb">
              <a><cite>首页</cite></a>
              <a><cite>扶贫管理</cite></a>
              <a><cite>添加商铺信息</cite></a>
            </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"  href="javascript:location.replace(location.href);" title="刷新"><i class="layui-icon" style="line-height:30px">ဂ</i></a>
</div>
<div class="x-body">
    <form class="layui-form layui-form-pane" action="" id="add">
        <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">

            <div class="layui-tab-content" >
                <div class="layui-tab-item layui-show">

                    <input type="hidden" name="id" value="">

                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class='x-red'>*</span>商铺门牌号
                        </label>
                        <div class="layui-input-block">
                            <input type="text" name="houseId" autocomplete="off" placeholder="商铺门牌号"
                                   class="layui-input" required="" lay-verify="required" value="">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class='x-red'>*</span>简单描述
                        </label>
                        <div class="layui-input-block">
                            <input type="text" name="msg" autocomplete="off" placeholder="简单描述"
                                   class="layui-input" lay-verify="required" value="">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class='x-red'>*</span>租用状态
                        </label>
                        <div class="layui-input-block">
                            <input type="text" name="state" autocomplete="off" placeholder="租用状态"
                                   class="layui-input" lay-verify="required" value="">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class='x-red'>*</span>租用期限
                        </label>
                        <div class="layui-input-block">
                            <input type="text" name="time" autocomplete="off" placeholder="租用期限"
                                   class="layui-input" lay-verify="required" value="">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class='x-red'>*</span>租用价格
                        </label>
                        <div class="layui-input-block">
                            <input type="text" name="price" autocomplete="off" placeholder="租用价格"
                                   class="layui-input" lay-verify="required" value="">
                        </div>
                    </div>


                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class='x-red'>*</span>联系方式
                        </label>
                        <div class="layui-input-block">
                            <input type="text" name="telphone" autocomplete="off" placeholder="联系方式"
                                   class="layui-input" lay-verify="required" value="">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <button class="layui-btn" type="button" lay-filter="add" lay-submit="">
                            保存
                        </button>
                    </div>
                    <!--</form>-->
                    <div style="height:100px;"></div>
                </div>



            </div>

        </div>
    </form>
</div>
<script src="../static/lib/layui/layui.js" charset="utf-8"></script>
<script src="../static/js/x-layui.js" charset="utf-8"></script>

<script>
    layui.use(['element','layer','form'], function(){
        $ = layui.jquery;//jquery
        lement = layui.element();//面包导航
        layer = layui.layer;//弹出层
        form = layui.form();
        okLoading.close($);

        //监听提交
        form.on('submit(add)', function(data){
            layer.msg("提交")
            var data=data.field;
            $.ajax({
                type:"post",
                url:"/store/add",
                data:data,
                dataType:"json",
                success:function(data)
                {
                    //alert(1);
                    if(data.result=="SUCCESS")
                    {
                        layer.msg(data.info, {icon: 6,time:2000},function () {
                            window.parent.location.reload();
                            var index = parent.layer.getFrameIndex(window.name);
                            parent.layer.close(index);
                        });
                        return false;

                    }
                    else{
                        layer.msg(data.info,{icon:5,time:2000});return false;
                    }
                }

            });

        });

    })
</script>


</body>
</html>